#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include "ui_mainwindow.h"
#include "DataSource.h"
#include "ELFReader.h"
#include "SymbolResolutionDialog.h"
#include "InspectorDialog.h"
#include "ColorPickerDialog.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
    ~MainWindow();

protected:
    bool outputXml;
    
private:
    Ui::MainWindowClass ui;
    QString scriptFilePath;
    QString bufferFilePath;
    QString elfFilePath;
    DataSource dataSource;
    QSqlTableModel model;
    SymbolResolutionDialog* symbolResolutionDialog;
    InspectorDialog* inspectorDialog;
    ColorPickerDialog* colorPickerDialog;
    ELFReader elfReader;

private slots:
    void openScriptFile();
    void openBufferFile();
    void openElfFile();
    void process();
    void setOutputXml(bool flag);
    void doXAxisEvents();
    void doXAxisTime();
    void doYAxisZoomIn();
    void doYAxisZoomOut();
    void doYAxisMoveUp();
    void doYAxisMoveDown();
    void doMutexLayerEnableAll();
    void doMutexLayerDisableAll();
    void render();
    void renderDummy();
    void renderMutex();
    void renderThreads();
    void updateVisualizer();
    void selectDataSourceTable(const QString& table);
    void filterDataSource();
    void symbolResolution();
    void showInspector();
    void showColorPicker();
};

#endif // MAINWINDOW_H
